From: Etienne Champetier Date: Mon, 18 Aug 2025 21:41:37 +0000 (-0400) Subject: deploy: call syncfs() for /ostree instead of / X-Git-Tag: archive/raspbian/2025.7-2+rpi1^2^2~6^2~2^2~4^2 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/%22stanciumarius94%40gmail.com//%22mailto:i18n-csb%40linuxcsb.org/%22/%22http:/www.example.com/%22stanciumarius94%40gmail.com/%22mailto:i18n-csb%40linuxcsb.org/%22?a=commitdiff_plain;h=6e5a27a29d33d50a2a4380c406405435d919b6b4;p=ostree.git deploy: call syncfs() for /ostree instead of / In full_system_sync we were calling syncfs(/) expecting all the recent modification in /ostree to be synced to disk. With / now being composefs, syncfs(/) is a noop, so call syncfs(/ostree) as that is what we really want. --- diff --git a/src/libostree/ostree-sysroot-deploy.c b/src/libostree/ostree-sysroot-deploy.c index 6cb6dd53..4abd7001 100644 --- a/src/libostree/ostree-sysroot-deploy.c +++ b/src/libostree/ostree-sysroot-deploy.c @@ -1634,21 +1634,22 @@ typedef struct guint64 boot_syncfs_msec; } SyncStats; -/* First, sync the root directory as well as /var and /boot which may - * be separate mount points. Then *in addition*, do a global - * `sync()`. +/* sync /ostree and /boot which may be separate mount points. */ static gboolean full_system_sync (OstreeSysroot *self, SyncStats *out_stats, GCancellable *cancellable, GError **error) { GLNX_AUTO_PREFIX_ERROR ("Full sync", error); - ot_journal_print (LOG_INFO, "Starting syncfs() for system root"); + ot_journal_print (LOG_INFO, "Starting syncfs() for /ostree"); guint64 start_msec = g_get_monotonic_time () / 1000; - if (syncfs (self->sysroot_fd) != 0) - return glnx_throw_errno_prefix (error, "syncfs(sysroot)"); + glnx_autofd int ostree_dfd = -1; + if (!glnx_opendirat (self->sysroot_fd, "ostree", TRUE, &ostree_dfd, error)) + return glnx_throw_errno_prefix (error, "glnx_opendirat(/ostree)"); + if (syncfs (ostree_dfd) != 0) + return glnx_throw_errno_prefix (error, "syncfs(/ostree)"); guint64 end_msec = g_get_monotonic_time () / 1000; - ot_journal_print (LOG_INFO, "Completed syncfs() for system root in %" G_GUINT64_FORMAT " ms", + ot_journal_print (LOG_INFO, "Completed syncfs() for /ostree in %" G_GUINT64_FORMAT " ms", end_msec - start_msec); out_stats->root_syncfs_msec = (end_msec - start_msec);